package com.jsu.information.controller.v1;

import com.jsu.information.service.FileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.model.common.dtos.ResponseResult;
import org.example.model.information.pojo.Information;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/information/api/oss/file")
@Api(tags = "腾讯云cos接口")
public class FileApiController {
 
	@Autowired
	private FileService fileService;
 
	@PostMapping("/fileUpload")
	@ApiOperation(value = "上传文件到腾讯云")
	public ResponseResult fileUpload(MultipartFile file){
		//获取上传文件(返回的为文件存储的路径)
		String url = fileService.fileUpload(file);
        return ResponseResult.okResult(url);
	}

}